package com.xbongbong.pro.statistic.model;

import com.xbongbong.pro.domain.entity.BiDataCorrelationEntity;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author 梁鲁江
 * @version v1.0
 * @date 2019/3/20 10:16
 * @since v1.0
 */
public interface BiDataCorrelationModel {
     Integer insert(BiDataCorrelationEntity entity);

     Integer update(BiDataCorrelationEntity entity);

     Integer save(BiDataCorrelationEntity entity);

     void insertBatch(List<BiDataCorrelationEntity> entityList);

     Integer deleteByKey(Long id, String corpid);

     BiDataCorrelationEntity getByKey(Long id, String corpid);

     List<BiDataCorrelationEntity> findEntitys(Map<String, Object> param);


    /**
     * 获取在第一个位置的实体
     * @param corpid
     * @param appId
     * @param formId
     * @param saasMark
     * @param businessType
     * @param relTable
     * @param location
     * @return
     */
     BiDataCorrelationEntity findByLocation(String corpid, Long appId, Long formId, Integer saasMark, Integer businessType,Integer relTable,Integer location, String linkAttr,String secondLinkAttr) ;

    /**
     *获取在不在第一个位置的实体
     * @param corpid
     * @param appId
     * @param formId
     * @param saasMark
     * @param businessType
     * @param relTable
     * @return
     */
     BiDataCorrelationEntity findSlaveLocation(String corpid, Long appId, Long formId, Integer saasMark, Integer businessType,Integer relTable, String linkAttr);

     Integer getEntitysCount(Map<String, Object> param);

    /**
     * 更新对应id的
     * @param idIn
     * @return
     */
     Integer updateWarehouseTime(Set<Long> idIn);

     Integer updateSyscAll(Set<Long> idIn);
}
